<?php 
require_once (dirname(__FILE__).'/services.php');

function seminars_index($matches) {
    global $mvc;
    
    $method = $_SERVER['REQUEST_METHOD'];
    
	if ($method == "GET") {
    	global $session_list;
		$session_list = service_seminars_get_sessionlist();
    	$mvc->render(dirname(__FILE__)."/views/_seminars_index_overview_.php");
    } elseif ($method == "POST") {
	
    }
}

function seminars_session_detail ($matches) {
	global $mvc;
	
	$method = $_SERVER['REQUEST_METHOD'];
	
	if ($method == "GET") {
		global $session;
		$session = service_seminars_get_session_by_id($matches['1']);
		$mvc->render(dirname(__FILE__)."/views/_seminars_session_detail_.php");
	} else if ($method == "POST") {
	
	}
}


function seminars_admin_add($matches) {

}

global $mvc;
$mvc = new MVC(Array(
	'{^/seminars/$}' => 'seminars_index',
	'{^/seminars/([0-9]+)/$}'=>'seminars_session_detail'
));
$mvc -> dispatch($GLOBALS['uri']);
?>